/*
	Copyright (c) 2010 <copyright holders>
	This source code is licensed under The MIT License,
	see the file LICENSE for details.
	*/

#ifndef SMOOTHFLOAT_HPP
#define SMOOTHFLOAT_HPP

namespace spelprog2 {

class SmoothFloat
{
public:
    SmoothFloat(float value = 0.0f, float speed = 0.1f);

    void update(float time);
    void set(float value, float speed = 0.1f);
    void setPeriodical(float value, float period, float speed = 0.1f);
    void setImmediate(float value);
    
    float get();
    float getDelta();
    
protected:
    float current, target, delta, speed;
};

}; //namespace spelprog2

#endif //SMOOTHFLOAT_HPP